package arrayListExercises.saveStudentList;

import java.util.ArrayList;

/**
 * @author: bamboo_shoot
 * @date: 20/2/6 12:53
 * @description: 返回查看所有学生
 */
public class ReturnStudent {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<Student>();
        Student s1 = new Student("zhangliang","29");
        Student s2 = new Student("wanglie","19");
        students.add(s1);
        students.add(s2);
        toSeeAll(students);
    }

    private static void toSeeAll(ArrayList<Student> students) {
            System.out.println("姓名"+"\t\t\t"+"年龄");
        for (Student student : students) {
            System.out.println(student.getName()+"\t\t"+student.getAge());
        }

    }
}
